package cn.wostore.wxhelper;

import android.app.Application;
import android.content.Intent;
import android.os.Process;
import cn.wostore.wxhelper.service.SyncWxDbService;
import cn.wostore.wxhelper.utils.L;
import com.facebook.stetho.Stetho;


/**
 * @author wuch
 * @date 2018/12/25 0025
 */
public class WxHelperApp extends Application {

    private static final String TAG = WxHelperApp.class.getSimpleName();
    private static WxHelperApp instance;

    @Override
    public void onCreate() {
        super.onCreate();
        L.d(TAG, "application create!");
        if (instance == null) {
            instance = this;
            L.d(TAG, "instance initialized!");
        }
        L.d(TAG, "pid "+Process.myPid());
        Stetho.initializeWithDefaults(this);
        startSyncWxDbService();
    }

    private void startSyncWxDbService(){
        Intent intent = new Intent(this, SyncWxDbService.class);
        startService(intent);
    }

    public static WxHelperApp getInstance() {
        return instance;
    }



}
